export class SinglyLinkedListNode<V = any> {
  #value: V;

  #next?: SinglyLinkedListNode<V>

  constructor(v: V) {
    this.#value = v
    this.#next = undefined
  }

  get value(): V {
    return this.#value
  }

  set value(v: V) {
    this.#value = v
  }

  get next(): SinglyLinkedListNode<V> | undefined {
    return this.#next
  }

  set next(node: SinglyLinkedListNode<V> | undefined) {
    this.#next = node
  }
}
